/* 管理后台样式 */

/* 管理员容器 */
.admin-container {
    display: flex;
    min-height: calc(100vh - 40px);
}

/* 管理员面板 */
.admin-panel {
    background-color: #343a40;
    color: white;
    padding: 10px 15px;
    text-align: center;
    font-weight: 500;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 侧边栏 */
.admin-sidebar {
    width: 250px;
    background-color: #343a40;
    color: white;
    flex-shrink: 0;
}

.admin-user {
    padding: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #495057;
}

.admin-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
}

.admin-user-info {
    flex: 1;
}

.admin-username {
    font-weight: 500;
    margin-bottom: 5px;
}

.admin-role {
    font-size: 12px;
    color: #adb5bd;
}

.admin-sidebar-menu {
    padding: 15px 0;
}

.admin-sidebar-item {
    padding: 12px 20px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.admin-sidebar-item:hover,
.admin-sidebar-item.active {
    background-color: #2c3136;
    border-left-color: #5bc0eb;
}

.admin-sidebar-link {
    color: #adb5bd;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-sidebar-link:hover,
.admin-sidebar-item.active .admin-sidebar-link {
    color: white;
}

.admin-sidebar-link i {
    font-size: 18px;
}

/* 主内容区 */
.admin-content {
    flex: 1;
    padding: 20px;
    background-color: #f8f9fa;
    overflow-y: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-header h1 {
    font-size: 24px;
    color: #343a40;
    margin: 0;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-search {
    position: relative;
}

.admin-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
}

.admin-search input {
    padding: 8px 10px 8px 35px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    width: 250px;
}

.admin-notifications {
    position: relative;
    cursor: pointer;
}

.admin-notifications i {
    font-size: 20px;
    color: #6c757d;
}

.badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #dc3545;
    color: white;
    font-size: 10px;
    font-weight: 600;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 统计卡片 */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
}

.stat-icon i {
    font-size: 24px;
}

.stat-info {
    flex: 1;
}

.stat-title {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 5px;
}

.stat-change {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-change.positive {
    color: #28a745;
}

.stat-change.negative {
    color: #dc3545;
}

/* 图表卡片 */
.admin-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chart-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-header h3 {
    font-size: 16px;
    margin: 0;
    color: #343a40;
}

.chart-actions select {
    padding: 5px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.chart-body {
    padding: 20px;
    height: 300px;
}

.chart-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.chart-placeholder img {
    max-width: 100%;
    max-height: 100%;
}

/* 最近活动 */
.admin-recent {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.recent-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.recent-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recent-header h3 {
    font-size: 16px;
    margin: 0;
    color: #343a40;
}

.view-all {
    font-size: 14px;
    color: #5bc0eb;
}

.recent-body {
    padding: 20px;
}

/* 表格样式 */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    font-weight: 600;
    color: #343a40;
    background-color: #f8f9fa;
}

.admin-table tbody tr:hover {
    background-color: #f8f9fa;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.table-actions {
    display: flex;
    gap: 5px;
}

.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: none;
    background-color: #f8f9fa;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background-color: #e9ecef;
    color: #343a40;
}

/* 用户列表 */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.user-avatar-md {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 500;
    color: #343a40;
    margin-bottom: 5px;
}

.user-email {
    font-size: 14px;
    color: #6c757d;
}

.user-joined {
    font-size: 14px;
    color: #6c757d;
}

/* 状态标识 */
.status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .admin-charts,
    .admin-recent {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        order: 2;
    }
    
    .admin-content {
        order: 1;
    }
    
    .admin-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .admin-search input {
        width: 100%;
    }
}